#!/usr/bin/env bash
# Copyright (c) 2024 maminjie <canpool@163.com>
# SPDX-License-Identifier: MulanPSL-2.0


method_def MODULE

usage_MODULE() {
    module_usage "MODULE" "module brief description"
}

do_MODULE() {
    module_do "MODULE" "$@"
}

MODULE_usage_help() {
    module_usage_help MODULE
}

# MODULE_do_help subcmd
MODULE_do_help() {
    module_do_help MODULE "$1"
}

# __MODULE_get_subcmd cmd
#   Get the fullname of cmd
# Returns:
#   "" or fullname
__MODULE_get_subcmd() {
    local cmd=""
    case "${1}" in
        "h"|"help")
            cmd="help"
            ;;
        "hello"|"helloworld")
            cmd="helloworld"
            ;;
        *)
            ;;
    esac
    echo "$cmd"
}


MODULE_usage_helloworld() {
printf "helloworld (hello): Hello to the world

usage:
    ${PROG} MODULE hello
\n"
}

MODULE_do_helloworld() {
    echo "hello world"
}
